package com.example.demo.dao;

import com.example.demo.entity.UserBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/*
 *
 *   @Author:max
 *   @Date: 2024/3/4-03-04-21:12
 *
 */
@Mapper
public interface IUserLoginDao {

    @Select("SELECT * FROM users WHERE username = #{username} And password = #{password}")
    UserBean selectByNameAndPass(UserBean userBean);

    @Insert("insert into users(phone,username,password,salt) VALUE (#{phone},#{phone},#{password},#{salt})")
    Integer insertUserByPhone(UserBean userBean);

    //通过手机号查询用户
    @Select("SELECT * FROM users WHERE phone = #{phone}")
    UserBean selectByPhone(UserBean userBean);

}
